<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s"  uri="/struts-tags" %>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
   	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
	<title>菜单管理</title>
    <link href="<%=request.getContextPath()%>/css/bootstrap.css" rel="stylesheet" type="text/css">
    <script src="<%=request.getContextPath()%>/js/jquery-2.0.3.min.js" type="text/javascript"></script>
    <script src="<%=request.getContextPath()%>/js/bootstrap.js" type="text/javascript"></script>  
    
        
    <link rel="stylesheet" href="<%=request.getContextPath()%>/css/bootstrapValidator.css"/>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/bootstrapValidator.js"></script>

    <script type="text/javascript">
    
    $(document).ready(function() {
    	$('#defaultForm')
        .bootstrapValidator({
            message: 'This value is not valid',
            fields: {
                "t.rolename": {
                    validators: {
                        notEmpty: {
                            message: '角色名称不能为空'
                        },
                        regexp: {
                            regexp: /^[\u4e00-\u9fa5]{2,10}$/,
                            message: '角色名称的长度必须在2-10个汉字'
                        }
                    }
                }
            }
        })
    });
    </script>
</head>
<body>
<div class="panel panel-primary">
  <div class="panel-heading">角色管理</div>
  <div class="panel-body">
    
	  <form id="defaultForm" class="form-horizontal" action="role/Role_save.action?params=showall&page=${page }" method="post">
	  
		 <div class="form-group">
		    <label for="t.rolename" class="col-sm-offset-3 col-sm-2 control-label">角色名称：</label>
		    <div class="col-sm-2">
		        <input class="form-control" type="text" name="t.rolename" id="text" placeholder="请输入角色名称" value="${t.rolename}">
		    </div>
		  </div>

		 <div class="form-group">
		    <label for="t.rolenameen" class="col-sm-offset-3 col-sm-2 control-label">角色英文名：</label>
		    <div class="col-sm-2">
		        <input class="form-control" type="text" name="t.rolenameen" id="rolenameen" placeholder="请输入角色英文名" value="${t.rolenameen}">
		    </div>
		  </div>
          
		  <c:if test="${empty method}" >
			  <input type="hidden" name="t.status" value="0">
		  </c:if>

	      <c:if test="${!empty method}" >
	          <input name="method" type="hidden" value="${method }">
			  <input type="hidden" name="t.rid" value="${t.rid}">
			  <input type="hidden" name="t.status" value="${t.status}">
		  </c:if>
		 
		  <div class="form-group">
		    <div class="col-sm-offset-5 col-sm-7">
		      <button type="submit" class="btn btn-default">提交</button>
		      <button type="reset" class="btn btn-default">重置</button>
		    </div>
		  </div>
      </form>
    
  </div>
  
</div>

</body>
</html>
